package org.extreme.model.reports.core;

class Rect {
	int left, top, right, bottom;
	
	protected Rect(int left, int top, int right, int bottom) {
		this.left = left;
		this.top = top;
		this.right = right;
		this.bottom = bottom;
	}
	
	protected void union(Rect rect) {
		if (rect == null) {
			return;
		}
		this.left = Math.min(this.left, rect.left);
		this.top = Math.min(this.top, rect.top);
		this.right = Math.max(this.right, rect.right);
		this.bottom = Math.max(this.bottom, rect.bottom);
	}
	
	public String toString() {
		return "{[" + this.left + "\u2192" + this.right + "],[" + this.top + "\u2193" + this.bottom + "]}";
	}
}
